package com.lh.controller;

import org.springframework.web.bind.annotation.*;

/**
 * @author: linghao
 * @since: 2022/7/21
 */
@RestController
public class TestController {


    @GetMapping ("/testC1")
    public String testC4(String name){
        System.out.println("testC1 "+name);
        return "testC1 "+name;
    }

    @PostMapping("/testC3")
    public String testC3(@RequestParam("name") String name,@RequestParam("val") String val){
        System.out.println("test "+name+" val:"+val);
        return "test "+name+" val:"+val;
    }

    @PostMapping("/testC5")
    public String testC5(@RequestBody String name){
        System.out.println("test "+name);
        return "test "+name;
    }

    @GetMapping ("/testC1/{name}")
    public String testC1(@PathVariable String name){
        return "test "+name;
    }

    @GetMapping ("/testC6/{name}/{test}/{test2}")
    public String testC6(@PathVariable String name,@PathVariable String test,@PathVariable String test2){
        return "test "+name+" "+test+" "+test2;
    }
}
